package com.zxjbyte.yiyi.framework.common.constant;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.time.format.DateTimeFormatter;
import java.util.regex.Pattern;

/**
 * @Author zhangxingjia
 * @Date 2023/3/1 17:35
 * @Version: 1.0
 */
public interface Constant {

    // 管理员租户id
    String ADMIN_TENANT_ID = "000000";

    // ====================时间相关常量===================

    String PATTERN_DATE = "yyyy-MM-dd";
    String PATTERN_TIME = "HH:mm:ss";
    String PATTERN_DATETIME = "yyyy-MM-dd HH:mm:ss";
    String PATTERN_DATETIME_MS = "yyyy-MM-dd HH:mm:ss.SSS";

    DateTimeFormatter DATETIME_FORMAT = DateTimeFormatter.ofPattern(PATTERN_DATETIME);
    DateTimeFormatter DATETIME_MS_FORMAT = DateTimeFormatter.ofPattern(PATTERN_DATETIME_MS);
    DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(PATTERN_DATE);
    DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern(PATTERN_TIME);

    // ====================字符集相关常量===================

    Charset CHARSET_ISO_8859_1 = StandardCharsets.ISO_8859_1;
    String ISO_8859_1 = CHARSET_ISO_8859_1.name();

    Charset CHARSET_GBK = Charset.forName("GBK");
    String GBK = CHARSET_GBK.name();

    Charset CHARSET_UTF_8 = StandardCharsets.UTF_8;
    String UTF_8 = CHARSET_UTF_8.name();




    // ====================网络相关常量===================
    String DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36";

    // 404错误码静态html页面, {}内容需要自行替换
    String STATUS_404_HTML = "<html><body><h1>404 - Not Found</h1><p>{}</p></body></html>";

    // ====================正则表达式常量===================
    // glob语法匹配
    Pattern PATTERN_GLOB = Pattern.compile("\\?|(/\\*{2}$)|\\*{2}|(/\\*$)|\\*");

    // ====================Bean name===================
    // 自定义线程池bean名字
    String DEFAULT_THREAD_POOL = "default-thread-pool";



    // ====================其他常量===================

    // int类型未设置值时的默认值
    int UNSET_INT = -1;

    // 系统发送邮件发件人
    String MAIL_FORM = "xxx@qq.com";

    // ====================基础路径常量===================

    // 插件路径
    String BASE_PATH_PLUGIN = "/p";
    // B端
    String BASE_PATH_B = "/b";
}
